# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=ksmtp
pkgver=23.08.4
pkgrel=0
pkgdesc="Job-based library to send email through an SMTP server"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://kontact.kde.org"
license="LGPL-2.1-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons5-dev
	ki18n5-dev
	kio5-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
_repo_url="https://invent.kde.org/pim/ksmtp.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/ksmtp-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Broken

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
3a94f0fd40a1cc234f56d8f61beb3056a397c5c2842b131b7dd83860b35ecff0befd997bc5be7359931e547b4fa5e681843899ff65c940aae241531393d833f6  ksmtp-23.08.4.tar.xz
"
